<!--#include file="common_head.html"-->
<div class="uk-container">
    <ul class="uk-breadcrumb dux-page-crumb">
        <li><a href="/">首页</a></li>
        <!--loop{$pageInfo.crumb as $vo}-->
        <li><a href="{$vo.url}">{$vo.name}</a></li>
        <!--{/loop}-->
    </ul>

    <div class="dux-page-banner">
        <div class="uk-cover-container">
            <img src="images/conpon-banner.jpg" uk-cover>
            <div class="uk-position-center banner-main">
                <div class="banner-info">
                    <div class="title">领券中心</div>
                    <p>发现更多超值优惠券</p>
                </div>
            </div>

        </div>
    </div>



<div class="uk-margin-large-top">

    <ul class="dux-coupon-list uk-child-width-1-2 uk-grid">
        <!--loop{$pageList as $vo}-->
        <li>
            <div class="dux-coupon-box">
                <div class="box-image">
                    <img src="{$vo.image}" alt="">
                </div>
                <div class="box-info">

                    <div class="title">
                        满{$vo.meet_money}减{$vo.money}券
                    </div>
                    <div class="desc">
                        {$vo.name}
                    </div>
                    <div class="time">
                        {date('Y-m-d', $vo.start_time)} ~ {date('Y-m-d', $vo.end_time)}
                    </div>

                </div>

                <div class="box-receive">

                    <div class="receive-press">
                        <!--if{!$vo.stock}-->
                        已抢光
                        <!--{else}-->
                        已抢{round($vo.receive * $vo.stock / 100)}%
                        <!--{/if}-->

                        <progress class="uk-progress" value="{$vo.receive}" max="{$vo.stock}">
                    </div>

                    <!--if{!$vo.receive_status}-->
                    <a href="javascript:;" class="receive receive-btn uk-button uk-button-primary" data-id="{$vo.coupon_id}">立即领取</a>
                    <!--{else}-->
                    <a href="{$vo.url}" class="receive receive-btn uk-button uk-button-default" data-id="{$vo.coupon_id}">立即使用</a>
                    <!--{/if}-->
                </div>

            </div>
        </li>
        <!--{/if}-->
    </ul>

    <br>
    <div class="dux-page-pager">
        {$page}
    </div>


</div>
</div>

<!--#include file="common_footer.html"-->

<script>
    Do('base', function () {
        $('.dux-coupon-list').on('click', '.receive', function () {
            var obj = this;
            app.ajax({
                url : "{url('receive')}",
                data : {
                    id : $(this).data('id')
                },
                success : function (msg) {
                    dialog.msg(msg);
                    $(obj).text('已领取');
                    $(obj).removeClass('uk-button-primary');
                    $(obj).addClass('uk-button-default');
                },
                error : function (msg) {
                    dialog.msg(msg);
                }
            });

        });
    });
</script>
</html>